package com.vic.designpattern.patterns.a_creational.simple_factory.a_general;

/**
 * 发送者工厂，用于创建发送者
 * @author victor
 */
public class SenderFactory {

    public Sender produce(String type) {
        if("email".equals(type)) {
            return new EmailSender();
        } else if("sms".equals(type)) {
            return new SmsSender();
        } else {
            System.out.println("请输入正确的类型");
            return null;
        }

    }

}
